'''
''' Override the DataBind to populate the DataGrid. Call MyBase.DataBind()
''' and then populate the ASP DataGrid.
'''
Public Overrides Sub DataBind()
' Call the MyBase.DataBind()
MyBase.DataBind()
If (Not Me.Page.IsPostBack) Then
Dim myDataGrid As System.Web.UI.WebControls.DataGrid
myDataGrid = CType(Me.FindControlRecursively("myDataGrid"), System.Web.UI.WebControls.DataGrid)
' If DataGrid is found then populate it.
If (Not myDataGrid Is Nothing) Then
Dim whereStr As String = Nothing
' Create orderBy clause
Dim ob As BaseClasses.Data.OrderBy = Nothing
' Set page index and size
Dim pageIndex As Integer = 0
Dim pageSize As Integer = 1000
' Set the DataSource of the DataGrid
myDataGrid.DataSource = ${${Table Name}ClassName}.GetDataTable(whereStr, ob, pageIndex, pageSize)
myDataGrid.DataBind()
End If
End If
End Sub
|